package com.hybrid.jsbridge;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 在此写用途
 *
 * @author: zhiwei
 * @date: 2017-10-09 22:53
 * @version: 9.1.0
 */
public class WVJsbridgeService {
    private static List<WVJSAPIAuthCheck> mPreprocessor = Collections.synchronizedList(new ArrayList<WVJSAPIAuthCheck>());

    private static List<WVAsyncAuthCheck> mAyncPreprocessor = Collections.synchronizedList(new ArrayList<WVAsyncAuthCheck>());

    public static void unregisterPreprocessor(final WVAsyncAuthCheck preprocessor) {
        mAyncPreprocessor.remove(preprocessor);
    }

    public static List<WVAsyncAuthCheck> getJSBridgeayncPreprocessors() {
        return mAyncPreprocessor;
    }

    public static void registerJsbridgePreprocessor(WVAsyncAuthCheck preprocessor) {
        WVJsbridgeService.mAyncPreprocessor.add(preprocessor);
    }

    public static void unregisterPreprocessor(final WVJSAPIAuthCheck preprocessor) {
        mPreprocessor.remove(preprocessor);
    }

    public static List<WVJSAPIAuthCheck> getJSBridgePreprocessors() {
        return mPreprocessor;
    }

    public static void registerJsbridgePreprocessor(WVJSAPIAuthCheck preprocessor) {
        WVJsbridgeService.mPreprocessor.add(preprocessor);
    }
}
